// pages/image/image.js
Page({
    data: {
        tempFilePaths: ''
    },
    uploadImg() {
        let that = this
        wx.chooseImage({
            count: 1,
            sizeType: ['original', 'compressed'],
            sourceType: ['album', 'camera'],
            success(res) {
                // tempFilePath可以作为 img 标签的 src 属性显示图片
                that.setData({
                    tempFilePaths: res.tempFilePaths
                })
            }
        })
    }
})